/* 防止FOUC (Flash of Unstyled Content) */
html {
  visibility: visible;
  opacity: 1;
}

/* 确保Ant Design样式优先加载 */
.ant-app {
  visibility: visible !important;
  opacity: 1 !important;
}

/* 页面加载完成前的过渡效果 */
body {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

body.loaded {
  opacity: 1;
}

@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.141 0.005 285.823);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.141 0.005 285.823);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.141 0.005 285.823);
  --primary: oklch(0.623 0.214 259.815);
  --primary-foreground: oklch(0.97 0.014 254.604);
  --secondary: oklch(0.967 0.001 286.375);
  --secondary-foreground: oklch(0.21 0.006 285.885);
  --muted: oklch(0.967 0.001 286.375);
  --muted-foreground: oklch(0.552 0.016 285.938);
  --accent: oklch(0.967 0.001 286.375);
  --accent-foreground: oklch(0.21 0.006 285.885);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.92 0.004 286.32);
  --input: oklch(0.92 0.004 286.32);
  --ring: oklch(0.623 0.214 259.815);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.141 0.005 285.823);
  --sidebar-primary: oklch(0.623 0.214 259.815);
  --sidebar-primary-foreground: oklch(0.97 0.014 254.604);
  --sidebar-accent: oklch(0.967 0.001 286.375);
  --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
  --sidebar-border: oklch(0.92 0.004 286.32);
  --sidebar-ring: oklch(0.623 0.214 259.815);
}

.dark {
  --background: oklch(0.141 0.005 285.823);
  --foreground: oklch(0.97 0.014 254.604);
  --card: oklch(0.141 0.005 285.823);
  --card-foreground: oklch(0.97 0.014 254.604);
  --popover: oklch(0.141 0.005 285.823);
  --popover-foreground: oklch(0.97 0.014 254.604);
  --primary: oklch(0.623 0.214 259.815);
  --primary-foreground: oklch(0.21 0.006 285.885);
  --secondary: oklch(0.21 0.006 285.885);
  --secondary-foreground: oklch(0.97 0.014 254.604);
  --muted: oklch(0.21 0.006 285.885);
  --muted-foreground: oklch(0.552 0.016 285.938);
  --accent: oklch(0.21 0.006 285.885);
  --accent-foreground: oklch(0.97 0.014 254.604);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.21 0.006 285.885);
  --input: oklch(0.21 0.006 285.885);
  --ring: oklch(0.623 0.214 259.815);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.141 0.005 285.823);
  --sidebar-foreground: oklch(0.97 0.014 254.604);
  --sidebar-primary: oklch(0.623 0.214 259.815);
  --sidebar-primary-foreground: oklch(0.21 0.006 285.885);
  --sidebar-accent: oklch(0.21 0.006 285.885);
  --sidebar-accent-foreground: oklch(0.97 0.014 254.604);
  --sidebar-border: oklch(0.21 0.006 285.885);
  --sidebar-ring: oklch(0.623 0.214 259.815);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

@layer utilities {
  /* Chrome, Safari and Opera */
  .scrollbar-hidden::-webkit-scrollbar {
    display: none;
  }

  .scrollbar-hidden {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
}

/* 滚动条整体样式 */
.scrollable-container::-webkit-scrollbar {
  width: 4px; /* 滚动条宽度 */
}

/* 滚动条轨道样式 */
.scrollable-container::-webkit-scrollbar-track {
  background-color: #f1f1f1; /* 轨道背景颜色 */
  border-radius: 2px; /* 轨道圆角 */
}

/* 滚动条滑块样式 */
.scrollable-container::-webkit-scrollbar-thumb {
  background-color: #888; /* 滑块颜色 */
  border-radius: 2px; /* 滑块圆角 */
}

/* 滚动条滑块悬停样式 */
.scrollable-container::-webkit-scrollbar-thumb:hover {
  background-color: #555; /* 悬停时滑块颜色 */
}

/* 学习详情弹窗的特定样式 */
.learning-detail-drawer[data-slot="dialog-content"] {
  position: fixed !important;
  right: 0 !important;
  top: 0 !important;
  left: auto !important;
  height: 100vh !important;
  width: 1000px !important;
  max-width: 95vw !important;
}

/* Ant Design Carousel 箭头样式覆盖 */
.slick-arrow.slick-next,
.slick-arrow.slick-prev {
  color: #1677ff !important;
  font-size: 24px !important;
  width: 24px !important;
  height: 24px !important;
  z-index: 10 !important;
}

.slick-arrow.slick-next {
  right: 10px !important;
}

.slick-arrow.slick-prev {
  left: 10px !important;
}

.slick-arrow::before {
  color: #1677ff !important;
  font-size: 24px !important;
  opacity: 0.8 !important;
}

.learning-detail-drawer[data-slot="dialog-content"] {
  transform: none !important;
  border-radius: 0 !important;
  border: none !important;
  border-left: 1px solid hsl(var(--border)) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-y: auto !important;
  animation: none !important;
}

@media (max-width: 1024px) {
  .learning-detail-drawer[data-slot="dialog-content"] {
    width: 900px !important;
  }
}

@media (max-width: 768px) {
  .learning-detail-drawer[data-slot="dialog-content"] {
    width: 90vw !important;
  }
}
